package com.cbi.clickhouse.controller;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.cbi.clickhouse.entity.Address;
import com.cbi.clickhouse.entity.Test;
import com.cbi.clickhouse.mapper.AddressMapper;
import com.cbi.clickhouse.mapper.TestMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Ivan.Qu
 * @date 16:55 2021/8/25
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/test")
public class TestController {
    private final TestMapper testMapper;
    private final AddressMapper addressMapper;


    @GetMapping
    public void test() {
        List<Test> testList = testMapper.selectList(Wrappers.<Test>query()
                .lambda()
        );
        log.info("{}", JSON.toJSONString(testList));
    }
}
